
<?php

class Application_Form_Login extends Validation_Form
{

  public function init()
  {
     $this->setName("zendForm");
     $this->setMethod('post');

    $email = $this->createElement('text', 'email');
    $email->setLabel('E-mail')
            ->setRequired(TRUE)
            ->setAttrib('size', 30)
            ->addFilters(array(
                new Zend_Filter_StringTrim(),
                new Zend_Filter_StripNewlines(),
                new Zend_Filter_StripTags()
            ))
            ->addValidators(array(
                new Zend_Validate_EmailAddress(),
                new Zend_Validate_NotEmpty()
           ));
    $password = $this->createElement('password', 'password');
    $password->setLabel('Hasło')
            ->setRequired(TRUE)
            ->setAttrib('size', 30)
            ->addFilters(array(
                new Zend_Filter_StringTrim(),
                new Zend_Filter_StripNewlines(),
                new Zend_Filter_StripTags()
            ))
            ->addValidators(array(
                new Zend_Validate_NotEmpty(),
				new Zend_Validate_StringLength(array('min' => 5, 'max' => 30))
            ));
 /**   $date = $this->createElement('text', 'date');
    $date->setLabel('Data')
            ->setRequired(TRUE)
            ->setAttrib('size', 30)
            ->addFilters(array(
                new Zend_Filter_StringToLower(),
                new Zend_Filter_StringTrim(),
                new Zend_Filter_StripNewlines(),
                new Zend_Filter_StripTags()
            ))
            ->addValidators(array(
               //new Zend_Validate_NotEmpty(),
	           new Zend_Validate_Date('YYYY-MM-DD')

           ));
        */
    $zapamietaj = $this->createElement('checkbox','remember');
    $zapamietaj->setLabel('Zapamiętaj hasło');
    $submit = new Zend_Form_Element_Submit('submit');
	$submit->setAttrib('id', 'submit');
    $this->addElements(array(
        $email,
        $password,
		//$date,
        $zapamietaj,
        $submit
        ));
  }

	
   


}

